package work.content.judge_generate;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.text.StrBuilder;
import com.alibaba.excel.EasyExcel;

import java.nio.charset.Charset;

public class Main {
    public static void main(String[] args) {
        StrBuilder sb = new StrBuilder();
        Setting.MyExcelReadListener listener = new Setting.MyExcelReadListener(
                (emailExcelObject, analysisContext) -> sb.append(emailExcelObject.getSqlItem()),
                analysisContext -> FileUtil.writeString(String.format(Setting.sql, sb.toString()), Setting.outPath, Charset.defaultCharset()));
        EasyExcel.read(Setting.dataPath, Setting.MyExcelObject.class, listener)
                .sheet()
                .doRead();
    }
}
